﻿@model IEnumerable<YodaMaster.Models.Student>

@{
    ViewBag.Title = "Students";
}
<p></p>
<p></p>

<h2>Students</h2>

@using (Html.BeginForm())
{
    <p>
        Find by name: @Html.TextBox("SearchString")  
        <input type="submit" value="Search" /></p>
}

<p>
    @Html.ActionLink("Create New", "Create")
</p>

<table border="1">
  <tr>
    <th></th>
    <th>
        @Html.ActionLink("Last Name", "Index", new { sortOrder=ViewBag.NameSortParm })
    </th>
    <th>
        First Name
    </th>
      <th> ID </th>
</tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.RecordID }) |
            @Html.ActionLink("Details", "Details", new { id=item.RecordID }) |
              @Html.ActionLink("Delete", "Delete", new {  id=item.RecordID })
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.LastName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.FirstMidName)
        </td>
        <td> @Html.DisplayFor(modelItem => item.StudentID) </td>
       
    </tr>
}

</table>